package com.fz.us.oa.core.entity.com;

import com.fz.us.admin.company.entity.BaseFlowEntity;
import com.fz.us.admin.dict.entity.DictItem;
import com.fz.us.oa.core.entity.common.FileManage;

import javax.persistence.*;
import java.util.Date;
import java.util.List;

/**
 * 业务实体类 - 印章使用申请表
 * ============================================================================
 * 版权所有 2016 。
 *
 * @author henryxu
 * @version 1.0 2016-12-12 。
 * ============================================================================
 */
@Entity
@Table(name="ec_seal")
public class Seal extends BaseFlowEntity {

    private static final long serialVersionUID = -7745911502151550644L;
    /**
     * 印章使用类型   1:○内部使用  2:○外借使用
     */
    private int useType;
    /**
     * 预计归还时间
     */
    private Date datPlanReturn;
    /**
     * 实际归还时间
     */
    private Date datFactReturn;
    /**
     * 印章字典项
     */
    private DictItem sealDictItem;
    /**
     * 使用事由
     */
    private String useReason;
    /**
     * 盖章份数
     */
    private int numSeal;
    /**
     * 附件
     */
    private List<FileManage> file;
    /**
     * 提交日期
     */
    private Date dateApply;
    /**
     * 文档状态数值
     */
    private int numStatus;
    /**
     * 文档状态文字
     */
    private String txtStatus;
    /**
     * 表单名称
     */
    private String form;

    @Column(nullable=false, columnDefinition = "varchar(50) default '印章使用申请表'")
    public String getForm() {
        return form;
    }

    public void setForm(String form) {
        this.form = form;
    }

    public int getUseType() {
        return useType;
    }

    public void setUseType(int useType) {
        this.useType = useType;
    }

    public Date getDatPlanReturn() {
        return datPlanReturn;
    }

    public void setDatPlanReturn(Date datPlanReturn) {
        this.datPlanReturn = datPlanReturn;
    }

    public Date getDatFactReturn() {
        return datFactReturn;
    }

    public void setDatFactReturn(Date datFactReturn) {
        this.datFactReturn = datFactReturn;
    }

    @ManyToOne(fetch = FetchType.LAZY)
    public DictItem getSealDictItem() {
        return sealDictItem;
    }

    public void setSealDictItem(DictItem sealDictItem) {
        this.sealDictItem = sealDictItem;
    }

    public String getUseReason() {
        return useReason;
    }

    public void setUseReason(String useReason) {
        this.useReason = useReason;
    }

    public int getNumSeal() {
        return numSeal;
    }

    public void setNumSeal(int numSeal) {
        this.numSeal = numSeal;
    }

    @ManyToMany(fetch = FetchType.LAZY)
    @JoinTable(name = "ec_seal_file", joinColumns = @JoinColumn(name="id"),inverseJoinColumns = @JoinColumn(name="fileId"))
    public List<FileManage> getFile() {
        return file;
    }

    public void setFile(List<FileManage> file) {
        this.file = file;
    }

    public Date getDateApply() {
        return dateApply;
    }

    public void setDateApply(Date dateApply) {
        this.dateApply = dateApply;
    }

    public int getNumStatus() {
        return numStatus;
    }

    public void setNumStatus(int numStatus) {
        this.numStatus = numStatus;
    }

    public String getTxtStatus() {
        return txtStatus;
    }

    public void setTxtStatus(String txtStatus) {
        this.txtStatus = txtStatus;
    }
}
